package net.system.base.module;

import java.util.ArrayList;
import java.util.List;

public class Table {
	private String alias;
	private String name;
	private String desc;
	private List<Column> list;
	
	public Table() {
		super();
		this.alias="";
		this.name = "";
		this.desc = "";
		this.list = new ArrayList<Column>();
	}
	
	public Table(String alias, String name, String desc, List<Column> list) {
		super();
		this.alias = alias;
		this.name = name;
		this.desc = desc;
		this.list = list;
	}

	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public List<Column> getList() {
		return list;
	}
	public void setList(List<Column> list) {
		this.list = list;
	}
	public void addColumn(Column column){
		list.add(column);
	}
	@Override
	public String toString() {
//		return "Table [alias=" + alias + ", name=" + name + ", desc=" + desc + "]";
		String sRes = String.format("Table [alias=%s,name=%s,desc:%s]",alias,name,desc); 
		for(Column col:list){
			sRes += col.toString();
		}
		return sRes;
	}
	
}
